package com.hue.springbootvalidation.controller;

import com.hue.springbootvalidation.domain.Person;
import com.hue.springbootvalidation.utils.R;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: yfq
 * @Date: 2022/8/4 16:12
 * @Description:
 */
@RestController
@RequestMapping("/person")
public class PersonController {
    @PostMapping("/save")
    public R save(@RequestBody @Validated Person person) {
        System.out.println(person);
        return R.ok();
    }
}
